/**
 *  test11.c - Test about pipe.
 *             It runs on ARMulator or ARM7TDMI CPU.
 *
 *  Copyright (C) 2008-2010 ZhangHu
 *  All rights reserved.
 *  E-MAIL: anmnmnly@gmail.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "drivers\uart_console.h"
#include "include\core.h"
#include "include\pipe.h"
#include "include\sem.h"


#define STACK_SIZE 4096
#define SAME_PRIO 63

sem_t *psem = NULL;

static pipe_t *p1 = NULL;
static pipe_t *p2 = NULL;
static pipe_t *p3 = NULL;
static pipe_t *p4 = NULL;
static pipe_t *p5 = NULL;
static pipe_t *p6 = NULL;

static char_t *msg[20] =  {
    { "The first message!" },
    { "The sencond message !" },
    { "The third message!" },
    { "The fourth message!" },
    { "The fifth message!" },
    { "The sixth message!" },
    { "The seventh message!" },
    { "The eighth message!" },
    { "The ninth message!" },
    { "The tenth message!" },
    { "The eleventh message!" },
    { "The twelveth message!" },
    { "The thirteenth message!" },
    { "The fourteenth message!" },
    { "The fifteenth message!" },
    { "The sixteenth message!" },
    { "The seventeenth message!" },
    { "The eighteenth message!" },
    { "The ninteenth message!" },
    { "The twentith message!" }
};



static void Task0(void) {
    uint32 i;
    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task0 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p1, msg[i]);
            }
            Print("Sending message to pipe1 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task1(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task1   is running!\n");
            Print("Task1   wants to send some data to pipe1!\n");
            pipeSend(p1, msg[0]);
            {
                Print(
                           "Task1 was refused to send some data to pipe1!\n\n");
            }
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task2(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task2   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task3(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task3   is running!\n");
            Print("Task3   wants to send some data to pipe2!\n");
            pipeSend(p2, msg[2]);
            {
                Print("Task3 was refused to send some data to pipe2!\n\n");
            }
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task4(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task4   is running!\n");
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task5(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task5   is running!\n");
            semPost(psem);
        }
        osWait(65);
    }
}




static void Task6(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task6   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task7(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task7   is running!\n");
            Print("Task7   wants to send some data to pipe3!\n");
            pipeSend(p3, msg[6]);
            {
                Print(
                           "Task7 was refused to send some data to pipe3!\n\n");
            }
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task8(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task8   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task9(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task9  is running!\n");
            semPost(psem);
        }
        osWait(568);
    }
}



static void Task10(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task10   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task11(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task11   is running!\n");
            semPost(psem);
        }
        osWait(458);
    }
}



static void Task12(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task12   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task13(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task13   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task14(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task14   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task15(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task15   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task16(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task16   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task17(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task17   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task18(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task18   is running!\n");
            semPost(psem);
        }
        osWait(24);
    }
}



static void Task19(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task19   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task20(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task20 is running!\n");
            Print("Now retrieve date from pipe1\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p1)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        kfree(str);
        osWait(24);
    }
}



static void Task21(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task21   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task22(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task22   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task23(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task23   is running!\n");
            semPost(psem);
        }
        osWait(123);
    }
}



static void Task24(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task24   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task25(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task25   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task26(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task26   is running!\n");
            semPost(psem);
        }
        osWait(58);
    }
}



static void Task27(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task27   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task28(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task28   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task29(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task29   is running!\n");
            semPost(psem);
        }
        osWait(156);
    }
}



static void Task30(void) {
    uint32 i;

    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task30 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p2, msg[i]);
            }
            Print("Sending message to pipe2 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task31(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task31   is running!\n");
            semPost(psem);
        }
        osWait(354);
    }
}



static void Task32(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task32   is running!\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task33(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task33   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task34(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task34   is running!\n");
            Print("Task34   wants to send some data to pipe4!\n");
            pipeSend(p4, msg[8]);
            {
                Print("Task34 was refused to send some data to pipe14\n\n");
            }
            semPost(psem);
        }
        osWait(568);
    }
}



static void Task35(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task35   is running!\n");
            semPost(psem);
        }
        osWait(456);
    }
}



static void Task36(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task36   is running!\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task37(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task37   is running!\n");
            semPost(psem);
        }
        osWait(111);
    }
}



static void Task38(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task38   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task39(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task39   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task40(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task40   is running!\n");
            semPost(psem);
        }
        osWait(2);
    }
}



static void Task41(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task41   is running!\n");
            semPost(psem);
        }
        osWait(32);
    }
}



static void Task42(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task42   is running!\n");
            semPost(psem);
        }
        osWait(44);
    }
}



static void Task43(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task43   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task44(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task4   is running!\n");
            semPost(psem);
        }
        osWait(25);
    }
}



static void Task45(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task45   is running!\n");
            semPost(psem);
        }
        osWait(32);
    }
}



static void Task46(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task46   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task47(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task47   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task48(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task48   is running!\n");
            semPost(psem);
        }
        osWait(4);
    }
}



static void Task49(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task49   is running!\n");
            semPost(psem);
        }
        osWait(10);
    }
}



static void Task50(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task50 is running!\n");
            Print("Now retrieve date from pipe2\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p2)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        kfree(str);
        osWait(86);
    }
}



static void Task51(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task51   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task52(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task52   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task53(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task53   is running!\n");
            semPost(psem);
        }
        osWait(96);
    }
}



static void Task54(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task54   is running!\n");
            semPost(psem);
        }
        osWait(78);
    }
}



static void Task55(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task55   is running!\n");
            semPost(psem);
        }
        osWait(36);
    }
}



static void Task56(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task56   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task57(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task57   is running!\n");
            semPost(psem);
        }
        osWait(25);
    }
}



static void Task58(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task58   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task59(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task59   is running!\n");
            semPost(psem);
        }
        osWait(16);
    }
}




static void Task60(void) {
    uint32 i;

    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task60 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p3, msg[i]);
            }
            Print("Sending message to pipe3 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task61(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task61   is running!\n");
            Print("Task61   wants to send some data to pipe5!\n");
            pipeSend(p5, msg[5]);
            {
                Print("Task61 was refused to send some data to pipe5!\n\n");
            }
            semPost(psem);
        }
        osWait(200);
    }
}



static void Task62(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task62   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task63(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task63   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task64(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task64   is running!\n");
            semPost(psem);
        }
        osWait(50);
    }
}



static void Task65(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task65   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task66(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task66   is running!\n");
            semPost(psem);
        }
        osWait(20);
    }
}



static void Task67(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task67   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task68(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task68   is running!\n");
            semPost(psem);
        }
        osWait(10);
    }
}



static void Task69(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task69   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task70(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task70   is running!\n");
            semPost(psem);
        }
        osWait(15);
    }
}



static void Task71(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task71   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task72(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task721   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task73(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task73   is running!\n");
            semPost(psem);
        }
        osWait(11);
    }
}



static void Task74(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task74   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task75(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task75   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task76(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task76   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task77(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task77   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task78(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task78   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task79(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task79   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task80(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task80 is running!\n");
            Print("Now retrieve date from pipe3\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p3)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task81(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task81   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task82(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task82   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task83(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task83   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task84(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task84   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task85(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task85   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task86(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task86   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task87(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task87   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task88(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task88   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task89(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task89   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task90(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task90   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task91(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task91   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task92(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task92   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task93(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task93   is running!\n");
            Print("Task93   wants to send some data to pipe6!\n");
            pipeSend(p6, msg[10]);
            {
                Print("Task93 was refused to send some data to pipe6!\n\n");
            }
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task94(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task94   is running!\n");
            semPost(psem);
        }
        osWait( - 1);
    }
}



static void Task95(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task95   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task96(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task96   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task97(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task97   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task98(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task98   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task99(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task99   is running!\n");
            semPost(psem);
        }
        osWait(~0);
    }
}



static void Task100(void) {
    uint32 i;
    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task100 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p4, msg[i]);
            }
            Print("Sending message to pipe4 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(150);
    }
}




static void Task101(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task101   is running!\n");
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task102(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task102   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task103(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task103   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task104(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task104   is running!\n");
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task105(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task105   is running!\n");
            semPost(psem);
        }
        osWait(65);
    }
}



static void Task106(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task106   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task107(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task107   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task108(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task108   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task109(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task109   is running!\n");
            semPost(psem);
        }
        osWait(568);
    }
}



static void Task110(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task110   is running!\n");
            semPost(psem);
        }
        osWait(68);
    }
}



static void Task111(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task111   is running!\n");
            semPost(psem);
        }
        osWait(458);
    }
}



static void Task112(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task112   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task113(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task113   is running!\n");
            Print("Task113 wants to retrieve data from pipe1!\n");
            pipeRev(p1);
            {
                Print("Task113 was refused to visit pipe1!\n\n");
            }
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task114(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task114   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task115(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task115   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task116(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task116   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task117(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task117   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task118(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task118   is running!\n");
            semPost(psem);
        }
        osWait(24);
    }
}



static void Task119(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task119  is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task120(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task120 is running!\n");
            Print("Now retrieve date from pipe4\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p4)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        kfree(str);
        osWait(24);
    }
}



static void Task121(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task121   is running!\n");
            semPost(psem);
        }
        osWait(23);
    }
}



static void Task122(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task122   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task123(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task123  is running!\n");
            semPost(psem);
        }
        osWait(123);
    }
}



static void Task124(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task24   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task125(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task125   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task126(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task126   is running!\n");
            semPost(psem);
        }
        osWait(58);
    }
}



static void Task127(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task127   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task128(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task128   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task129(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task129   is running!\n");
            semPost(psem);
        }
        osWait(156);
    }
}



static void Task130(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task130   is running!\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task131(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task131   is running!\n");
            semPost(psem);
        }
        osWait(354);
    }
}



static void Task132(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task132   is running!\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task133(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task133   is running!\n");
            Print("Task133 wants to retrieve data from pipe2!\n");
            pipeRev(p2);
            {
                Print("Task133 was refused to visit pipe2!\n\n");
            }
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task134(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task134   is running!\n");
            semPost(psem);
        }
        osWait(568);
    }
}



static void Task135(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task135   is running!\n");
            semPost(psem);
        }
        osWait(456);
    }
}



static void Task136(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task136   is running!\n");
            semPost(psem);
        }
        osWait(125);
    }
}



static void Task137(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task137   is running!\n");
            semPost(psem);
        }
        osWait(111);
    }
}



static void Task138(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task138   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task139(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task139   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task140(void) {
    uint32 i;

    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task140 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p5, msg[i]);
            }
            Print("Sending message to pipe5 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(2);
    }
}



static void Task141(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task141   is running!\n");
            semPost(psem);
        }
        osWait(32);
    }
}



static void Task142(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task142   is running!\n");
            semPost(psem);
        }
        osWait(44);
    }
}



static void Task143(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task143   is running!\n");
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task144(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task144   is running!\n");
            semPost(psem);
        }
        osWait(25);
    }
}



static void Task145(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task145   is running!\n");
            semPost(psem);
        }
        osWait(32);
    }
}



static void Task146(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task146   is running!\n");
            semPost(psem);
        }
        osWait(56);
    }
}



static void Task147(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task147   is running!\n");
            Print("Task147 wants to retrieve data from pipe3!\n");
            pipeRev(p3);
            {
                Print("Task147 was refused to visit pipe3!\n\n");
            }
            semPost(psem);
        }
        osWait(45);
    }
}



static void Task148(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task148   is running!\n");
            semPost(psem);
        }
        osWait(4);
    }
}



static void Task149(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task149   is running!\n");
            semPost(psem);
        }
        osWait(10);
    }
}



static void Task150(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task150   is running!\n");
            semPost(psem);
        }
        osWait(86);
    }
}



static void Task151(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task151   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task152(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task152   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task153(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task153   is running!\n");
            semPost(psem);
        }
        osWait(96);
    }
}



static void Task154(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task154   is running!\n");
            semPost(psem);
        }
        osWait(78);
    }
}



static void Task155(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task155   is running!\n");
            semPost(psem);
        }
        osWait(36);
    }
}



static void Task156(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task156   is running!\n");
            semPost(psem);
        }
        osWait(35);
    }
}



static void Task157(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task157   is running!\n");
            semPost(psem);
        }
        osWait(25);
    }
}



static void Task158(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task158   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task159(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task159   is running!\n");
            semPost(psem);
        }
        osWait(16);
    }
}



static void Task160(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task160 is running!\n");
            Print("Now retrieve date from pipe5\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p5)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        kfree(str);
        osWait(100);
    }
}



static void Task161(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task161   is running!\n");
            semPost(psem);
        }
        osWait(200);
    }
}



static void Task162(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task162   is running!\n");
            Print("Task162 wants to retrieve data from pipe4!\n");
            pipeRev(p4);
            {
                Print("Task113 was refused to visit pipe4!\n\n");
            }
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task163(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task163   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task164(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task164   is running!\n");
            semPost(psem);
        }
        osWait(50);
    }
}



static void Task165(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task165   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task166(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task166   is running!\n");
            semPost(psem);
        }
        osWait(20);
    }
}



static void Task167(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task167   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task168(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task168   is running!\n");
            semPost(psem);
        }
        osWait(10);
    }
}



static void Task169(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task169   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task170(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task170   is running!\n");
            semPost(psem);
        }
        osWait(15);
    }
}



static void Task171(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task171   is running!\n");
            semPost(psem);
        }
        osWait(12);
    }
}



static void Task172(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task172   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task173(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task173   is running!\n");
            semPost(psem);
        }
        osWait(11);
    }
}



static void Task174(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task174   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task175(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task175   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task176(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task176   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task177(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task177   is running!\n");
            Print("Task177 wants to retrieve data from pipe5!\n");
            pipeRev(p5);
            {
                Print("Task113 was refused to visit pipe5!\n\n");
            }
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task178(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task178   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task179(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task179   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task180(void) {
    uint32 i;

    while(1) {
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task180 is running!\n");
            for(i = 0; i < 30; i++) {
                pipeSend(p6, msg[i]);
            }
            Print("Sending message to pipe6 is over!\n");
            Print(".....................\n\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task181(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task181   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task182(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task182   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task183(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task183   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task184(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task184   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task185(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task185   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task186(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task186   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task187(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task187   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task188(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task188   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task189(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task189   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task190(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task190   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task191(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task191   is running!\n");
            Print("Task191 wants to retrieve data from pipe6!\n");
            pipeRev(p6);
            {
                Print("Task191 was refused to visit pipe6!\n\n");
            }
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task192(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task192   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task193(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task193   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task194(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task194   is running!\n");
            semPost(psem);
        }
        osWait( - 1);
    }
}



static void Task195(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task195   is running!\n");
            semPost(psem);
        }
        osWait(100);
    }
}



static void Task196(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task196   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task197(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task197   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task198(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task198   is running!\n");
            semPost(psem);
        }
        osWait(0);
    }
}



static void Task199(void) {
    while(1) {
        semGain(psem);
        {
            Print("Task199   is running!\n");
            semPost(psem);
        }
        osWait(~0);
    }
}



static void Task200(void) {
    uint32 i;
    char_t *str;

    while(1) {
        str = (char_t*)kmalloc(51);
        semGain(psem);
        {
            Print(".....................\n");
            Print("Task200 is running!\n");
            Print("Now retrieve date from pipe6\n");
            for(i = 0; i < 30; i++) {
                if((str = (char_t*)pipeRev(p6)) != NULL) {
                    Print("the %d message is:\n", i);
                    Print("%s\n\n", str);
                }
            }
            Print(".....................\n\n");
            semPost(psem);
        }
        kfree(str);
        osWait(50);
    }
}



void Main(void) {
    p1 = pipeInit(100, 120, 20);
    p2 = pipeInit(130, 150, 20);
    p3 = pipeInit(160, 180, 20);
    p4 = pipeInit(200, 1120, 20);
    p5 = pipeInit(1140, 1160, 20);
    p6 = pipeInit(1180, 2000, 20);

    psem = semInit(1);

    osInitTask(Task0, 100, 0, 5, STACK_SIZE);
    osInitTask(Task1, 101, 1, 5, STACK_SIZE);
    osInitTask(Task2, 102, 2, 5, STACK_SIZE);
    osInitTask(Task3, 103, 3, 5, STACK_SIZE);
    osInitTask(Task4, 104, 4, 5, STACK_SIZE);
    osInitTask(Task5, 105, 5, 5, STACK_SIZE);
    osInitTask(Task6, 106, 6, 5, STACK_SIZE);
    osInitTask(Task7, 107, 7, 5, STACK_SIZE);
    osInitTask(Task8, 108, 8, 5, STACK_SIZE);
    osInitTask(Task9, 109, 9, 5, STACK_SIZE);
    osInitTask(Task10, 110, 10, 5, STACK_SIZE);
    osInitTask(Task11, 111, 11, 5, STACK_SIZE);
    osInitTask(Task12, 112, 12, 5, STACK_SIZE);
    osInitTask(Task13, 113, 13, 5, STACK_SIZE);
    osInitTask(Task14, 114, 14, 5, STACK_SIZE);
    osInitTask(Task15, 115, 15, 5, STACK_SIZE);
    osInitTask(Task16, 116, 16, 5, STACK_SIZE);
    osInitTask(Task17, 117, 17, 5, STACK_SIZE);
    osInitTask(Task18, 118, 18, 5, STACK_SIZE);
    osInitTask(Task19, 119, 19, 5, STACK_SIZE);
    osInitTask(Task20, 120, 20, 5, STACK_SIZE);
    osInitTask(Task21, 121, 21, 5, STACK_SIZE);
    osInitTask(Task22, 122, 22, 5, STACK_SIZE);
    osInitTask(Task23, 123, 23, 5, STACK_SIZE);
    osInitTask(Task24, 124, 24, 5, STACK_SIZE);
    osInitTask(Task25, 125, 25, 5, STACK_SIZE);
    osInitTask(Task26, 126, 26, 5, STACK_SIZE);
    osInitTask(Task27, 127, 27, 5, STACK_SIZE);
    osInitTask(Task28, 128, 28, 5, STACK_SIZE);
    osInitTask(Task29, 129, 29, 5, STACK_SIZE);
    osInitTask(Task30, 130, 30, 5, STACK_SIZE);
    osInitTask(Task31, 131, 31, 5, STACK_SIZE);
    osInitTask(Task32, 132, 32, 5, STACK_SIZE);
    osInitTask(Task33, 133, 33, 5, STACK_SIZE);
    osInitTask(Task34, 134, 34, 5, STACK_SIZE);
    osInitTask(Task35, 135, 35, 5, STACK_SIZE);
    osInitTask(Task36, 136, 36, 5, STACK_SIZE);
    osInitTask(Task37, 137, 37, 5, STACK_SIZE);
    osInitTask(Task38, 138, 38, 5, STACK_SIZE);
    osInitTask(Task39, 139, 39, 5, STACK_SIZE);
    osInitTask(Task40, 140, 40, 5, STACK_SIZE);
    osInitTask(Task41, 141, 41, 5, STACK_SIZE);
    osInitTask(Task42, 142, 42, 5, STACK_SIZE);
    osInitTask(Task43, 143, 43, 5, STACK_SIZE);
    osInitTask(Task44, 144, 44, 5, STACK_SIZE);
    osInitTask(Task45, 145, 45, 5, STACK_SIZE);
    osInitTask(Task46, 146, 46, 5, STACK_SIZE);
    osInitTask(Task47, 147, 47, 5, STACK_SIZE);
    osInitTask(Task48, 148, 48, 5, STACK_SIZE);
    osInitTask(Task49, 149, 49, 5, STACK_SIZE);
    osInitTask(Task50, 150, 50, 5, STACK_SIZE);
    osInitTask(Task51, 151, 51, 5, STACK_SIZE);
    osInitTask(Task52, 152, 52, 5, STACK_SIZE);
    osInitTask(Task53, 153, 53, 5, STACK_SIZE);
    osInitTask(Task54, 154, 54, 5, STACK_SIZE);
    osInitTask(Task55, 155, 55, 5, STACK_SIZE);
    osInitTask(Task56, 156, 56, 5, STACK_SIZE);
    osInitTask(Task57, 157, 57, 5, STACK_SIZE);
    osInitTask(Task58, 158, 58, 5, STACK_SIZE);
    osInitTask(Task59, 159, 59, 5, STACK_SIZE);
    osInitTask(Task60, 160, 60, 5, STACK_SIZE);
    osInitTask(Task61, 161, 61, 5, STACK_SIZE);
    osInitTask(Task62, 162, 62, 5, STACK_SIZE);
    osInitTask(Task63, 163, 63, 5, STACK_SIZE);
    osInitTask(Task64, 164, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task65, 165, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task66, 166, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task67, 167, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task68, 168, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task69, 169, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task70, 170, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task71, 171, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task72, 172, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task73, 173, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task74, 174, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task75, 175, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task76, 176, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task77, 177, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task78, 178, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task79, 179, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task80, 180, 33, 5, STACK_SIZE);
    osInitTask(Task81, 181, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task82, 182, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task83, 183, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task84, 184, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task85, 185, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task86, 186, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task87, 187, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task88, 188, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task89, 189, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task90, 190, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task91, 191, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task92, 192, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task93, 193, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task94, 194, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task95, 195, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task96, 196, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task97, 197, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task98, 198, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task99, 199, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task100, 200, 10, 5, STACK_SIZE);
    osInitTask(Task101, 1101, 1, 5, STACK_SIZE);
    osInitTask(Task102, 1102, 2, 5, STACK_SIZE);
    osInitTask(Task103, 1103, 3, 5, STACK_SIZE);
    osInitTask(Task104, 1104, 4, 5, STACK_SIZE);
    osInitTask(Task105, 1105, 5, 5, STACK_SIZE);
    osInitTask(Task106, 1106, 6, 5, STACK_SIZE);
    osInitTask(Task107, 1107, 7, 5, STACK_SIZE);
    osInitTask(Task108, 1108, 8, 5, STACK_SIZE);
    osInitTask(Task109, 1109, 9, 5, STACK_SIZE);
    osInitTask(Task110, 1110, 10, 5, STACK_SIZE);
    osInitTask(Task111, 1111, 11, 5, STACK_SIZE);
    osInitTask(Task112, 1112, 12, 5, STACK_SIZE);
    osInitTask(Task113, 1113, 13, 5, STACK_SIZE);
    osInitTask(Task114, 1114, 14, 5, STACK_SIZE);
    osInitTask(Task115, 1115, 15, 5, STACK_SIZE);
    osInitTask(Task116, 1116, 16, 5, STACK_SIZE);
    osInitTask(Task117, 1117, 17, 5, STACK_SIZE);
    osInitTask(Task118, 1118, 18, 5, STACK_SIZE);
    osInitTask(Task119, 1119, 19, 5, STACK_SIZE);
    osInitTask(Task120, 1120, 20, 5, STACK_SIZE);
    osInitTask(Task121, 1121, 21, 5, STACK_SIZE);
    osInitTask(Task122, 1122, 22, 5, STACK_SIZE);
    osInitTask(Task123, 1123, 23, 5, STACK_SIZE);
    osInitTask(Task124, 1124, 24, 5, STACK_SIZE);
    osInitTask(Task125, 1125, 25, 5, STACK_SIZE);
    osInitTask(Task126, 1126, 26, 5, STACK_SIZE);
    osInitTask(Task127, 1127, 27, 5, STACK_SIZE);
    osInitTask(Task128, 1128, 28, 5, STACK_SIZE);
    osInitTask(Task129, 1129, 29, 5, STACK_SIZE);
    osInitTask(Task130, 1130, 30, 5, STACK_SIZE);
    osInitTask(Task131, 1131, 31, 5, STACK_SIZE);
    osInitTask(Task132, 1132, 32, 5, STACK_SIZE);
    osInitTask(Task133, 1133, 33, 5, STACK_SIZE);
    osInitTask(Task134, 1134, 34, 5, STACK_SIZE);
    osInitTask(Task135, 1135, 35, 5, STACK_SIZE);
    osInitTask(Task136, 1136, 36, 5, STACK_SIZE);
    osInitTask(Task137, 1137, 37, 5, STACK_SIZE);
    osInitTask(Task138, 1138, 38, 5, STACK_SIZE);
    osInitTask(Task139, 1139, 39, 5, STACK_SIZE);
    osInitTask(Task140, 1140, 40, 5, STACK_SIZE);
    osInitTask(Task141, 1141, 41, 5, STACK_SIZE);
    osInitTask(Task142, 1142, 42, 5, STACK_SIZE);
    osInitTask(Task143, 1143, 43, 5, STACK_SIZE);
    osInitTask(Task144, 1144, 44, 5, STACK_SIZE);
    osInitTask(Task145, 1145, 45, 5, STACK_SIZE);
    osInitTask(Task146, 1146, 46, 5, STACK_SIZE);
    osInitTask(Task147, 1147, 47, 5, STACK_SIZE);
    osInitTask(Task148, 1148, 48, 5, STACK_SIZE);
    osInitTask(Task149, 1149, 49, 5, STACK_SIZE);
    osInitTask(Task150, 1150, 50, 5, STACK_SIZE);
    osInitTask(Task151, 1151, 51, 5, STACK_SIZE);
    osInitTask(Task152, 1152, 52, 5, STACK_SIZE);
    osInitTask(Task153, 1153, 53, 5, STACK_SIZE);
    osInitTask(Task154, 1154, 54, 5, STACK_SIZE);
    osInitTask(Task155, 1155, 55, 5, STACK_SIZE);
    osInitTask(Task156, 1156, 56, 5, STACK_SIZE);
    osInitTask(Task157, 1157, 57, 5, STACK_SIZE);
    osInitTask(Task158, 1158, 58, 5, STACK_SIZE);
    osInitTask(Task159, 1159, 59, 5, STACK_SIZE);
    osInitTask(Task160, 1160, 60, 5, STACK_SIZE);
    osInitTask(Task161, 1161, 61, 5, STACK_SIZE);
    osInitTask(Task162, 1162, 62, 5, STACK_SIZE);
    osInitTask(Task163, 1163, 63, 5, STACK_SIZE);
    osInitTask(Task164, 1164, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task165, 1165, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task166, 1166, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task167, 1167, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task168, 1168, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task169, 1169, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task170, 1170, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task171, 1171, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task172, 1172, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task173, 1173, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task174, 1174, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task175, 1175, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task176, 1176, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task177, 1177, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task178, 1178, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task179, 1179, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task180, 1180, 29, 5, STACK_SIZE);
    osInitTask(Task181, 1181, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task182, 1182, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task183, 1183, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task184, 1184, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task185, 1185, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task186, 1186, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task187, 1187, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task188, 1188, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task189, 1189, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task190, 1190, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task191, 1191, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task192, 1192, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task193, 1193, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task194, 1194, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task195, 1195, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task196, 1196, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task197, 1197, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task198, 1198, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task199, 1199, SAME_PRIO, 5, STACK_SIZE);
    osInitTask(Task200, 2000, 32, 5, STACK_SIZE);

    Print("Start Main Task!\n");
}

